#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Lcy
# @Date:   2016-09-20 15:34:41
# @Last Modified by:   Lcy
# @Last Modified time: 2016-09-21 13:14:32
import socket
from lib.util import url2ip
class Exploit:
    def __init__(self,target):
        self.target = target
        self.result = {
            "name": "Redis未授权访问",
            "author": "Lcy",
            "type": "webserver",
            "ref": "https://phpinfo.me",
            "status":False,
            "info":"",
            'filename':expfile + ".py",
            "target":target,
        }
    def verify(self):
        s = socket.socket()
        socket.setdefaulttimeout(5)
        try:
            host = url2ip(self.target)
            port = 6379
            s.connect((host, port))
            self.result['status'] = True
            self.result['info'] = '%s目标存在redis未授权访问' % self.target
        except Exception,e:
            pass
        s.close()
       